package ch09;

import java.util.StringTokenizer;

class _44_StringTokenizerEx5 {
	public static void main(String[] args) {
		String data = "100,, ,200,300";
		String[] result = data.split(",");
		for (int i = 0; i < result.length; i++)
			System.out.print(result[i] + "|");
		System.out.println("개수: " + result.length);
		
		StringTokenizer st = new StringTokenizer(data, ",");
		int i = 0;
		for (; st.hasMoreTokens(); i++)
			System.out.print(st.nextToken() + "|");
		System.out.println("개수:" + i);

		st = new StringTokenizer(data, ",", true);
		int j = 0;
		for (; st.hasMoreTokens(); j++)
			System.out.print(st.nextToken() + "|");
		System.out.println("개수:" + j);
	}
}

/*
100|| |200|300|개수: 5
100| |200|300|개수:4
100|,|,| |,|200|,|300|개수:8
 */
